package com.project.platform.service.impl;

import com.project.platform.entity.CheckupRecord;
import com.project.platform.mapper.CheckupRecordMapper;
import com.project.platform.service.CheckupRecordService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import com.project.platform.vo.PageVO;

import java.util.List;
import java.util.Map;

/**
 * ${table.name}
 */
@Service
public class CheckupRecordServiceImpl  implements CheckupRecordService {
    @Resource
    private CheckupRecordMapper checkupRecordMapper;
    
    @Override
    public PageVO<CheckupRecord> page(Map<String, Object> query, Integer pageNum, Integer pageSize) {
        PageVO<CheckupRecord> page = new PageVO();
        List<CheckupRecord> list = checkupRecordMapper.queryPage((pageNum - 1) * pageSize, pageSize, query);
        page.setList(list);
        page.setTotal(checkupRecordMapper.queryCount(query));
        return page;
    }

    @Override
    public CheckupRecord selectById(Integer id) {
        CheckupRecord checkupRecord = checkupRecordMapper.selectById(id);
        return checkupRecord;
    }

    @Override
    public List<CheckupRecord> list() {
        return checkupRecordMapper.list();
    }
    @Override
    public void insert(CheckupRecord entity) {
        check(entity);
        checkupRecordMapper.insert(entity);
    }
    @Override
    public void updateById(CheckupRecord entity) {
        check(entity);
        checkupRecordMapper.updateById(entity);
    }
    private void check(CheckupRecord entity) {

    }
    @Override
    public void removeByIds(List<Integer> ids) {
        checkupRecordMapper.removeByIds(ids);
    }
}
